package collention;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Arrays;

public class CollectionToArray {
    public static void main(String[] args) {
        Collection<String> C=new ArrayList<>();
        C.add("one");
        C.add("two");
        C.add("there");
        C.add("four");
        C.add("five");
        C.add("six");
        C.add("seven");
String [] array=C.toArray(new String[8]);
System.out.println( Arrays.toString(array));
String [] yy=C.toArray(new String[0]);
System.out.println(Arrays.toString(yy));
String [] PO=C.toArray(new String[5]);
System.out.println(Arrays.toString(PO));
    }
}
